/**
 * Vista para el indexador de documentos
 * Antes de proceder a crear los archivos indices
 * se debe crear el directorio "Index_Files"
 * y luego dentro los archivos
 */
package view;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import view.panels.IndexJPanel;
import view.panels.SearchJPanel;
/**
 *
 * @author
 * Guerino
 */
public class MainFrame extends javax.swing.JFrame {
    private IndexJPanel IndexPanel;
    private SearchJPanel SearchPanel;
    /**
     * Creates
     * new
     * form
     * MainFrame
     */
    public MainFrame() {
        initComponents();
        this.setTitle("Buscador Documental V1.0 | DLC - UTN-FRC 2012");
        this.setIconImage (new ImageIcon(getClass().getResource("/view/resource/database-search.png")).getImage());
        
        this.IndexPanel = new IndexJPanel();
        this.SearchPanel = new SearchJPanel();
        ImageIcon iconIndex = new ImageIcon(getClass().getResource("/view/resource/page_attach.png"));
        ImageIcon iconSearch = new ImageIcon(getClass().getResource("/view/resource/Zoom.png"));
        
        this.jTabbedPaneMain.removeAll();
        this.jTabbedPaneMain.addTab(" Buscar ",iconSearch, SearchPanel, "Realizar busquedas de documentos");
        this.jTabbedPaneMain.addTab("Indizar archivos...",iconIndex, IndexPanel, "Iniciar el indexador de documentos");       
        
       
        //Ajustar controles y contenedores
        this.pack();
        //Centro el JFrame en la pantalla
        this.setLocationRelativeTo(null);

    }

   
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jTabbedPaneMain = new javax.swing.JTabbedPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenuArchivo = new javax.swing.JMenu();
        jMenuItemSalir = new javax.swing.JMenuItem();
        jMenuAyuda = new javax.swing.JMenu();
        jMenuItemAcercade = new javax.swing.JMenuItem();

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 428, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 239, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Buscador uuuh! V1.0 | DLC- UTN FRC - 2012");

        jMenuArchivo.setText("Archivo");

        jMenuItemSalir.setText("Salir");
        jMenuItemSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemSalirActionPerformed(evt);
            }
        });
        jMenuArchivo.add(jMenuItemSalir);

        jMenuBar1.add(jMenuArchivo);

        jMenuAyuda.setText("Ayuda");

        jMenuItemAcercade.setText("Acerca de...");
        jMenuItemAcercade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemAcercadeActionPerformed(evt);
            }
        });
        jMenuAyuda.add(jMenuItemAcercade);

        jMenuBar1.add(jMenuAyuda);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPaneMain, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(jTabbedPaneMain, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemAcercadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAcercadeActionPerformed
        // TODO add your handling code here:
        // Ventana Acerca de...
         JOptionPane.showMessageDialog(this,"Realizado por: \n\tPalacios, Javier Güerino\nUniversidad Tecnológica Nacional "
                 + "- Facultad Regional Córdoba\nCátedra: Diseño de Lenguajes de Consulta 4K6-2012" );
    }//GEN-LAST:event_jMenuItemAcercadeActionPerformed

    private void jMenuItemSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSalirActionPerformed
        // TODO add your handling code here:
        this.dispose();
        System.exit(0);
    }//GEN-LAST:event_jMenuItemSalirActionPerformed

    /**
     * @param
     * args
     * the
     * command
     * line
     * arguments
     */
    public static void main(String args[]) {
        
        /*
         * Set
         * the
         * Nimbus
         * look
         * and
         * feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If
         * Nimbus
         * (introduced
         * in
         * Java
         * SE
         * 6)
         * is
         * not
         * available,
         * stay
         * with
         * the
         * default
         * look
         * and
         * feel.
         * For
         * details
         * see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            /*for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("System".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    
                    break;
                }
            }*/
             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create
         * and
         * display
         * the
         * form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenuArchivo;
    private javax.swing.JMenu jMenuAyuda;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItemAcercade;
    private javax.swing.JMenuItem jMenuItemSalir;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTabbedPane jTabbedPaneMain;
    // End of variables declaration//GEN-END:variables
}
